package kr.hkit.android_bookmgr.DTO;

import android.os.Parcel;
import android.os.Parcelable;

public class BookData implements Parcelable { //사용! 

	
	public int id;
	public String bookimg="";
	public int imgtype;
	public String name="";
	public String author="";
	public String publisher="";
	public String price="";
	public String description="";
	public String startdate="";
	public String enddate="";
	public int totalpage;
	public int currentpage;
	public int progress;
	public int status;
	
	
	
	public BookData(int id, String bookimg, String name, int imgtype, int progress ) {
		super();
		this.id = id;
		this.bookimg = bookimg;
		this.name = name;
		this.imgtype = imgtype;
		this.progress = progress;
		
	}
	
	public BookData(int id, String name, String author, String publisher, 
			String bookimg, int imgtype, int status, int totalpage, int currentpage, String startdate, String enddate) {
		super();
		this.id = id;
		this.name = name;
		this.author = author;
		this.publisher = publisher;
		this.bookimg = bookimg;
		this.imgtype = imgtype;
		this.status = status;
		this.totalpage = totalpage;
		this.currentpage = currentpage;
		this.startdate = startdate;
		this.enddate = enddate;
		
	}
	
	public BookData(Parcel in) {
		readFromParcel(in);
	}

	public BookData() {
	}
	



	public int getId() {
		return id;
	}


	public void setId(int id) {
		this.id = id;
	}


	public String getBookimg() {
		return bookimg;
	}


	public void setBookimg(String bookimg) {
		this.bookimg = bookimg;
	}


	public int getImgtype() {
		return imgtype;
	}


	public void setImgtype(int imgtype) {
		this.imgtype = imgtype;
	}


	public String getName() {
		return name;
	}


	public void setName(String name) {
		this.name = name;
	}


	public String getAuthor() {
		return author;
	}


	public void setAuthor(String author) {
		this.author = author;
	}


	public String getPublisher() {
		return publisher;
	}


	public void setPublisher(String publisher) {
		this.publisher = publisher;
	}


	public String getPrice() {
		return price;
	}


	public void setPrice(String price) {
		this.price = price;
	}


	public String getDescription() {
		return description;
	}


	public void setDescription(String description) {
		this.description = description;
	}


	public String getStartdate() {
		return startdate;
	}


	public void setStartdate(String startdate) {
		this.startdate = startdate;
	}


	public String getEnddate() {
		return enddate;
	}


	public void setEnddate(String enddate) {
		this.enddate = enddate;
	}


	public int getTotalpage() {
		return totalpage;
	}


	public void setTotalpage(int totalpage) {
		this.totalpage = totalpage;
	}


	public int getCurrentpage() {
		return currentpage;
	}


	public void setCurrentpage(int currentpage) {
		this.currentpage = currentpage;
	}


	public int getProgress() {
		return progress;
	}


	public void setProgress(int progress) {
		this.progress = progress;
	}


	public int getStatus() {
		return status;
	}


	public void setStatus(int status) {
		this.status = status;
	}

	
	@Override
	public int describeContents() {
		return 0;
	}

	@Override
	public void writeToParcel(Parcel dest, int flags) {
		dest.writeInt(id);
		dest.writeString(bookimg);
		dest.writeInt(imgtype);
		dest.writeInt(status);
		dest.writeString(name);
		dest.writeString(author);
		dest.writeString(publisher);
		dest.writeInt(totalpage);
		dest.writeInt(currentpage);
		dest.writeString(startdate);
		dest.writeString(enddate);
		
	}
	
	
	private void readFromParcel(Parcel in){
		id = in.readInt();
		bookimg = in.readString();
		imgtype = in.readInt();
		status = in.readInt();
		name = in.readString();
		author = in.readString();
		publisher = in.readString();
		totalpage = in.readInt();
		currentpage = in.readInt();
		startdate = in.readString();
		enddate = in.readString();
		
	}
	
	public static final Parcelable.Creator<BookData> CREATOR = new Parcelable.Creator<BookData>() {

		@Override
		public BookData createFromParcel(Parcel source) {
			
			return new BookData(source);
		}

		@Override
		public BookData[] newArray(int size) {
			return new BookData[size];
		}
	};

	
	
	
	
	
}
